import 'dart:convert';

DoctorPatientEntity conversationEntityFromJson(String str) =>
    DoctorPatientEntity.fromJson(json.decode(str));
String conversationEntityToJson(DoctorPatientEntity data) =>
    json.encode(data.toJson());

///医生所有聊天的患者列表
class DoctorPatientEntity {
  DoctorPatientEntity({
    this.code,
    this.data,
    this.message,
  });

  int code;
  List<Datum> data;
  String message;

  factory DoctorPatientEntity.fromJson(Map<String, dynamic> json) =>
      DoctorPatientEntity(
        code: json["code"],
        data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
        message: json["message"],
      );

  Map<String, dynamic> toJson() => {
        "code": code,
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
        "message": message,
      };
}

class Datum {
  Datum({
    this.ownClinic,
    this.modifyTime,
    this.doctorId,
    this.createTime,
    this.keyId,
    this.talkStatusId,
    this.personId,
    this.talkType,
    this.talkStatusName,
    this.orgId,
    this.timestamp,
  });

  int ownClinic;
  String modifyTime;
  String doctorId;
  String createTime;
  String keyId;
  int talkStatusId;
  String personId;
  int talkType;
  String talkStatusName;
  String orgId;
  String timestamp;

  factory Datum.fromJson(Map<String, dynamic> json) => Datum(
        ownClinic: json["ownClinic"],
        modifyTime: json["modifyTime"],
        doctorId: json["doctorID"],
        createTime: json["createTime"],
        keyId: json["keyID"],
        talkStatusId: json["talkStatusID"],
        personId: json["personID"],
        talkType: json["talkType"],
        talkStatusName: json["talkStatusName"],
        orgId: json["orgID"],
        timestamp: json["timestamp"],
      );

  Map<String, dynamic> toJson() => {
        "ownClinic": ownClinic,
        "modifyTime": modifyTime,
        "doctorID": doctorId,
        "createTime": createTime,
        "keyID": keyId,
        "talkStatusID": talkStatusId,
        "personID": personId,
        "talkType": talkType,
        "talkStatusName": talkStatusName,
        "orgID": orgId,
        "timestamp": timestamp
      };
}

PatientEntity patientEntityFromJson(String str) =>
    PatientEntity.fromJson(json.decode(str));
String patientEntityToJson(PatientEntity data) => json.encode(data.toJson());

class PatientEntity {
  PatientEntity({
    this.code,
    this.data,
    this.message,
  });

  int code;
  List<PatientDatum> data;
  String message;

  factory PatientEntity.fromJson(Map<String, dynamic> json) => PatientEntity(
        code: json["code"],
        data: List<PatientDatum>.from(
            json["data"].map((x) => PatientDatum.fromJson(x))),
        message: json["message"],
      );

  Map<String, dynamic> toJson() => {
        "code": code,
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
        "message": message,
      };
}

class PatientDatum {
  PatientDatum({
    this.area,
    this.birthDay,
    this.city,
    this.sex,
    this.latitude,
    this.keyId,
    this.faceImage,
    this.personName,
    this.province,
    this.phone,
    this.createAccountStatus,
    this.email,
    this.longitude,
  });

  String area;
  String birthDay;
  String city;
  int sex;
  String latitude;
  String keyId;
  String faceImage;
  String personName;
  String province;
  String phone;
  int createAccountStatus;
  String email;
  String longitude;

  factory PatientDatum.fromJson(Map<String, dynamic> json) => PatientDatum(
        area: json["area"],
        birthDay: json["birthDay"],
        city: json["city"],
        sex: json["sex"],
        latitude: json["latitude"],
        keyId: json["keyID"],
        faceImage: json["faceImage"],
        personName: json["personName"],
        province: json["province"],
        phone: json["phone"],
        createAccountStatus: json["createAccountStatus"],
        email: json["email"],
        longitude: json["longitude"],
      );

  Map<String, dynamic> toJson() => {
        "area": area,
        "birthDay": birthDay,
        "city": city,
        "sex": sex,
        "latitude": latitude,
        "keyID": keyId,
        "faceImage": faceImage,
        "personName": personName,
        "province": province,
        "phone": phone,
        "createAccountStatus": createAccountStatus,
        "email": email,
        "longitude": longitude,
      };
}
